//
//  CoolLog.h
//  CoolFramework
//
//  Created by Felix on 12-10-10.
//  Copyright (c) 2012年 FelixApp. All rights reserved.
//

#import <Foundation/Foundation.h>

#define COOLLOG_FLAG_ERROR    (1 << 0)  // 0...0001
#define COOLLOG_FLAG_WARN     (1 << 1)  // 0...0010
#define COOLLOG_FLAG_INFO     (1 << 2)  // 0...0100

#define COOLLOG_LEVEL_OFF     0
#define COOLLOG_LEVEL_ERROR   (COOLLOG_FLAG_ERROR)                                      // 0...0001
#define COOLLOG_LEVEL_WARN    (COOLLOG_FLAG_ERROR | COOLLOG_FLAG_WARN)                    // 0...0011
#define COOLLOG_LEVEL_INFO    (COOLLOG_FLAG_ERROR | COOLLOG_FLAG_WARN | COOLLOG_FLAG_INFO)  // 0...0111

#ifdef DEBUG
#define COOLLOG_LEVEL     COOLLOG_LEVEL_INFO
#else
#define COOLLOG_LEVEL     COOLLOG_LEVEL_ERROR
#endif

#define LogError(frmt, ...)   [CoolLog logErrorWithFormat:(frmt), ##__VA_ARGS__]
#define LogWarning(frmt, ...) [CoolLog logWarningWithFormat:(frmt), ##__VA_ARGS__]

#ifdef DEBUG
#define LogInfo(frmt, ...)    printf("class: <%p %s:(%d) > method: %s \n%s\n", self, [[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String], __LINE__, __PRETTY_FUNCTION__, [[NSString stringWithFormat:(frmt), ##__VA_ARGS__] UTF8String] )//[CoolLog logInfoWithFormat:(frmt), ##__VA_ARGS__]
#else
#define LogInfo(format, ...)
#endif



@interface CoolLog : NSObject

+ (void)logErrorWithFormat:(NSString *)format, ...;
+ (void)logWarningWithFormat:(NSString *)format, ...;
+ (void)logInfoWithFormat:(NSString *)format, ...;
@end
